package com.java2104.mapper;

import com.java2104.entity.Notice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NoticeMapper {

    List<Notice> findNotices(String title,String content);

    @Insert("insert into notice_inf value(null,#{title},#{content},now(),#{createUser.id})")
    int insert(Notice notice);

    @Update("update notice_inf set title=#{title},content=#{content} where id=#{id}")
    int updateByPrimaryKey(Notice notice);//没写完
//    @Select("select * from notice_inf where id=#{param1}")
    Notice findByPrimaryKey(Integer id);

    int batchDelete(List<Integer> ids);
}
